﻿using System;
using System.Windows;

namespace Infragistics.Composite.Wpf.Samples.Infrastructure
{
    public class SplitPanes
    {
        public const string LeftSidePaneName = "SPLITPANE_LeftSide";
        public const string RightSidePaneName = "SPLITPANE_RightSide";

        static SplitPanes s_styles;

        readonly Style _leftSidePaneStyle;
        readonly Style _rightSidePaneStyle;

        public static SplitPanes Styles
        {
            get
            {
                if (s_styles == null)
                    s_styles = new SplitPanes();

                return s_styles;
            }
        }

        private SplitPanes()
        {
            ResourceDictionary paneStyles = Application.LoadComponent(
                new Uri("Infragistics.Composite.Wpf.Samples.Infrastructure;component/SplitPaneStyles.xaml", UriKind.Relative)) 
                as ResourceDictionary;

            _leftSidePaneStyle = paneStyles[LeftSidePaneName] as Style;
            _rightSidePaneStyle = paneStyles[RightSidePaneName] as Style;
        }

        /// <summary>
        /// The Style applied to the <see cref="SplitPane"/> initially docked 
        /// to the left side of the <see cref="XamDockManager"/> region.
        /// </summary>
        public Style LeftSidePane { get { return _leftSidePaneStyle; } }

        /// <summary>
        /// The Style applied to the <see cref="SplitPane"/> initially docked 
        /// to the right side of the <see cref="XamDockManager"/> region.
        /// </summary>
        public Style RightSidePane { get { return _rightSidePaneStyle; } }
    }
}